Kandria Dialogue Format
This document describes the markup syntax used for dialogues in Kandria. The basis for this is Speechless. Please see its documentation first and foremost. Here we will only outline extensions and functions specific to Kandria.
One specific extension is the retrieval of language-specific strings (such as for items). In order to splice this into dialogue you can use the following:
{#@strings-tag}
Where strings-tag is the name of an entry in the strings.lisp file. Eg: {#@fi-nametag} would place Fi's name. Or {#@item:small-health-pack} would place the title of the small health pack item.
The instruction ! can execute a variety of commands when encountered:
goJump to a given label in the dialoguespeedChange the text scrolling speedcameraControl the camera:shakeCause the screen to shake for a bitmoveMove the camera to another locationzoomChange the camera's zoom levelrollChange the camera's roll angleresetReset the camera to the standard view
moveMove a character to another locationsetfChange the value of a game variable or parameterevalEvaluate arbitrary Lisp code expressions
Particularly useful functions are:activateactivate a triggerdeactivatedeactivate a triggercompletecomplete a trigger successfullyfailfail a triggeractive-preturns T if the given triggers are all activecomplete-preturns T if the given triggers are all completed successfullyfailed-preturns T if the given triggers are all marked as failedhavereturns T if the player has the given item in their inventory
Eg:(have 'item:mushroom 10)returns T if the player has at least 10 mushrooms.item-countreturns the count of the given item the player has in their inventory.storeadds the given item to the player's inventory. Optionally specify the number of the item to give
Eg:(store 'item:small-health-pack 5)Give the player five small health packs.retrieveremoves the given item from the player's inventory. Optionally specify the number of items to remove
Eg:(retrieve 'item:quest-item)Remove the quest item from the player's inventory.unitreturns the entity with the given name
Eg:(unit 'catherine)returns Catherine. This can be useful for more specific state management.(setf location)sets the location of the given entity. A location may be another entity or another entity's name.
Eg:(setf (location 'player) 'some-area)spawnspawn an NPC or enemy in the world. Requires a location and entity type as arguments.
Eg:(spawn 'player 'zombie)Spawn a zombie at the player's location.statusShow a status message. This is typically automated for most events, but might be useful in rare cases.
Eg:(status "Something changed...")move-toMake an entity move to a location.
Eg:(move-to 'player 'catherine)Makes Catherine move to where the player currently is.leadMake an entity lead another to a location.
Eg:(lead 'player 'cave 'catherine)Makes Catherine lead the player to the cave marker.followMake an entity follow another.
Eg:(follow 'player 'catherine)Makes Catherine follow the player around.stop-followingStop leading or following and return to standard AI activities.
Eg:(stop-following 'catherine)Makes Catherine stop following anywhere..walk-n-talkInitiate a walk and talk sequence where dialogue is played as the player has control.
Eg:(walk-n-talk 'my-interaction)Plays the interaction namedmy-interactionas a walk-n-talk dialogue. Note: you cannot use choices in such interactions, but everything else is available. Be mindful of line length, too.interrupt-walk-n-talkInterrupt the walk-n-talk dialogue to show another dialogue temporarily.
Eg:(interrupt-walk-n-talk "| Hey, wait!")Interrupt the current dialogue with this piece. Note: you need to manually deactivate the interruption again.
Eg:(interrupt-walk-n-talk NIL)to deactivate the interruption.varaccess and manipulate variables. The variable with the requested name that is closest on the binding stack is used. (see variables)
Eg:(var 'foo)will return the value offoo
Eg:(setf (var 'foo) 0)will set the value offooto0.contained-pChecks whether a given type of entity is within a region.
Eg:(contained-p 'wolf 'market)returns T if there's at least one wolf enemy within the chunk named market.moveDirectly control movement of the character
The following movements are possible::left,:right,:jump,:drop,:stop.
Eg:(move :left 'catherine)stopStop the direct movement or pathing of a character
Eg: ``(stop 'catherine)ensure-nearbyEnsure that the characters are near a place and teleport them there if they're not yet there.
Eg:(ensure-nearby 'market 'catherine 'fi)resetReset a quest, task, or trigger to its initial state. This will make it inactive again and reset all variables and descendant objects.
Eg:(reset 'sq3-race)reset*Reset a quest, task, or trigger but without touching its variable state.
Eg:(reset* 'sq3-race)
Also see documentation on the quest system for information on how quests, tasks, and interactions are meant to be understood.
If you're worried about the use of Lisp code, see the Lisp crash course for a quick introduction and explanation.
Editor integration
Visual Studio Code
We created an extension to offer syntax highlighting in VSC. To use it, simply clone our extension into VSC's extensions folder. On Windows, that's %USERPROFILE%\.vscode\extensions\ and elsewhere that's ~/.vscode/extensions/.
The extension can be found here: https://github.com/shirakumo/markless-vsc
Once it has been cloned in, restart VSC, and it should automatically be activated. You can test this by opening any file with the .mess or .spess extension.
Emacs
The emacs package markless can be installed from melpa. To activate it after installing, simply add this to your config:
(autoload 'markless-mode "markless" "" t nil)
(add-to-list 'auto-mode-alist '("\\.mess\\'" . markless-mode))
(add-to-list 'auto-mode-alist '("\\.spess\\'" . markless-mode))Alternatively you can find the source here: https://github.com/shirakumo/markless.el